<template>
<!-- 顶部通栏 -->
  <AppNavbar />

  <!-- 头部组件 -->
  <AppHeader>头部组件</AppHeader>

    <!-- 吸顶头部 -->
  <AppHeaderSticky />

  <!-- 内容容器 -->
  <div class="app-body">
      <!-- 二级路由 -->
      <router-view />
  </div>

  <!-- 底部组件 -->
  <AppFooter>底部组件</AppFooter>
</template>

<script>
// 引入一级路由组件
import AppNavbar from '@/components/app-navbar.vue'
import AppHeader from '@/components/app-header.vue'
import AppFooter from '@/components/app-footer.vue'
import AppHeaderSticky from '@/components/app-header-sticty.vue'
// 引入store
import { useStore } from 'vuex'
export default {
  name: 'Layout',
  components: {
    AppNavbar,
    AppHeader,
    AppFooter,
    AppHeaderSticky
  },
  setup () {
    const store = useStore()
    store.dispatch('category/getList')
  }
}
</script>

<style scoped lang="less">
.app-body{
  min-height: 600px;
}
</style>
